/* ********************************************************************************************
*  Alvin Baldemeca
*  Tetris Project
*  Course: TCSS 305 , Alan Fowler
*  Term: Spring 2012
*  UNIVERISTY OF WASHINGTON TACOMA
*
*
**********************************************************************************************/

package gui.actions;

import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent;


import javax.swing.AbstractAction;
import javax.swing.Action;
import view.TetrisGUI;





/**
 *This action stops the timer from dropping the tetris piece.
 *@author Alvin Baldemeca
 *@version 5/25/2012
 */
@SuppressWarnings("serial")
public class PracticeAction extends AbstractAction
{

  /**
   * The tetris gui to stop the timer and set the board and panel to 
   * the initial condition.
   */
  private final TetrisGUI my_gui;
  
  /**
   * Creates a PauseAction.
   * @param the_gui the GUI to stop the timer and set the board and panel to 
   * the initial condition.   
   */
  public PracticeAction(final TetrisGUI the_gui)
  {
    super("Practice");
    putValue(Action.MNEMONIC_KEY, KeyEvent.VK_P);
    putValue(Action.SELECTED_KEY, true);
    my_gui = the_gui;
  }

  @Override
  public void actionPerformed(final ActionEvent the_event) 
  {
    my_gui.restGUI();
  }
}